def genSubRule(lol): opdict = {} for t in lol: minItem = sorted(t, key=lambda x: len(x))[0] for x in t: opdict[x] = minItem return opdict
genSubRule=lambda lol: {x: sorted(t, key=lambda x: len(x))[0] for t in lol for x in t}
isPrime=lambda x: False if x<2 or x%2==0 else not any([x%i==0 for i in range(3,int(x**.5)+1,2)])